// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import layer from 'vue-layer'
import 'vue-layer/lib/vue-layer.css';
import win from '../static/sockets'
import VueI18n from 'vue-i18n'
import ElementUI, { Main } from 'element-ui';
import VueClipboard from 'vue-clipboard2'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import twLocale from 'element-ui/lib/locale/lang/zh-TW'
import deLocale from 'element-ui/lib/locale/lang/de'
import frLocale from 'element-ui/lib/locale/lang/fr'
import esLocale from 'element-ui/lib/locale/lang/es'
import jsonExcel from 'vue-json-excel'

Vue.component('downloadExcel', jsonExcel)
Vue.use(VueClipboard)
Vue.use(VueI18n);
let c_i18n = localStorage.getItem("c_i18n");
const i18n = new VueI18n({
  locale: c_i18n?c_i18n:'en_US', // 语言标识
  messages: {
      'zh_CN': Object.assign(require('./assets/lang/ZH'),zhLocale), // 中文语言包
      //'zh_TW': Object.assign(require('./assets/lang/TC'),twLocale), // 繁体语言包
      'en_US': Object.assign(require('./assets/lang/EN'),enLocale), // 英文语言包
	  'de_DE': Object.assign(require('./assets/lang/DE'),deLocale), // 德语语言包
	  'fr_FR': Object.assign(require('./assets/lang/FR'),frLocale), // 法语语言包
	  'es_ES': Object.assign(require('./assets/lang/ES'),esLocale), // 西班牙语语言包
  }
})
document.title = "QtGlobal";
let win$ = {};
win$.wsmsg = win;
Vue.prototype.win$ = win$
Vue.prototype.$layer = layer(Vue);
Vue.prototype.$layer = layer({
    msgtime: 3 // 目前只有一项，即msg方法的默认消失时间，单位：秒
});
//ElementUI
Vue.use(ElementUI,{i18n: (key, value) => i18n.t(key, value)})
// Vue.use(ELEMENT,{});
/* eslint-disable no-new */
var vm = new Vue({
  el: '#app',
  i18n,
  router,
  render: h => h(App),
  mounted() {
      document.dispatchEvent(new Event('render-event'))
  },
  store,
  // components: { App },
  // template: '<App/>'
})
export default vm
